home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 05 - 1989 / 05.08 Aug 89 / POOPDraw Code ƒ / PoopDrawInc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-06-13  |  4.4 KB  |  136 lines  |  [TEXT/KAHL]

  1. /********************************************************************/
  2. /*                                                                    */
  3. /*                    POOPDRAW.h                                        */
  4. /*                                                                    */
  5. /*    This file precompiles into PoopDrawInc, included throughout        */
  6. /*                                                                    */
  7. /********************************************************************/
  8.  
  9. #include <MacHeaders>
  10.  
  11. /********************************************************************/
  12. /*                                                                    */
  13. /*                    Data Structures                                    */
  14. /*                                                                    */
  15. /********************************************************************/
  16.  
  17. typedef long *LPtr;
  18. typedef int *IPtr;
  19.  
  20. /*--------------------------------------------------------------------*/
  21. typedef struct
  22. {
  23.     short                penSize;    
  24.     short                penPat;
  25.     short                fillPat;
  26.  
  27. }    DrawStateRec, *DrawStatePtr, **DrawStateHandle;
  28.  
  29. /*--------------------------------------------------------------------*/
  30. /*    The fields to be included in every Object                           */    
  31. /*--------------------------------------------------------------------*/
  32. #define     __JUMPTABLE        void        (*dispatch)();        
  33. #define     _FLD1            WindowPtr    port;
  34. #define     _FLD2            int         class;                
  35. #define     _FLD3            int         length;        
  36. #define     _FLD4            Rect        bounds;                
  37. #define     _FLD5            int            attributes;        
  38.  
  39.  
  40. #define _StdObjectFields    __JUMPTABLE    _FLD1 _FLD2 _FLD3 _FLD4 _FLD5
  41.  
  42. /********************************************************************/
  43.  
  44. typedef struct Object
  45. {
  46.     _StdObjectFields
  47. } ObjectRec,*ObjectPtr,**ObjectHandle;
  48. /*------------------------------------------------------------------*/
  49.  
  50. typedef struct
  51. {
  52.     _StdObjectFields
  53.     DrawStateRec drawState;
  54.         
  55. }    DrawObjectRec,*DrawObjectPtr,**DrawObjectHandle;
  56.  
  57. /*--------------------------------------------------------------------*/
  58.  
  59. typedef struct
  60. {
  61.     Str255            fName;            /* Filename for title bar */
  62.     Rect            wRect;            /* Position of the window */
  63.     int                fileVol;        /* volume where file resides */
  64.     short            curTool;        /* The current Tool */
  65.     short            curPat;            /* The current Pattern */
  66.     short            curWeight;        /* The current Line Weight */
  67.     DrawStateRec    drawState;        /* draw state to give new objects */
  68.     long            nObjects;        /* how many objects in document */
  69. }
  70.     FileHeaderRec,*FileHeaderPtr;
  71.  
  72. /********************************************************************/
  73. /*                                                                    */
  74. /*                    MESSAGES     in no special order!                */
  75. /*                                                                    */
  76. /********************************************************************/
  77.  
  78.  
  79. enum { INIT = 110,DISPOSE,OPEN,CLOSE };
  80. enum { MOUSEDOWN = 120,KEYDOWN,UPDATE,ACTIVATE,DEACTIVATE,IDLE };
  81. enum { UNDO = 130,CUT,COPY,PASTE,ERASE,INVAL };
  82. enum { MOVE = 140,RESIZE,GROW,HIDE,SHOW     };
  83.  
  84. enum { FILL = 150,PENSIZE,PENPAT     };    
  85. enum { FRAME = 160,DRAW ,DRAWHANDLES };
  86. enum { SAVE = 170, SAVEAS, PACK, UNPACK };
  87. enum { BRINGTOFRONT = 180, SENDTOBACK, GROUP, UNGROUP };
  88. enum { SELECT = 190,UNSELECT,CLRSELECT,SELECTRECT,DUPLICATE };
  89. enum { ADDOBJECT = 200, DELOBJECT,FIND,GETSIZE};
  90. enum { GETDRAWSTATE = 210,GETTOOL, SETACTIVETEXT,CLRACTIVETEXT};
  91. enum { FIRST = 220, NEXT, PREV,LAST,APPEND,LOAD,SETLEN,TRACK};
  92. /* ------------------------------------------------------------ */
  93. /*                    OBJECTS                                        */
  94. /* ------------------------------------------------------------ */
  95.  
  96. enum {     LIST=10,DRAWWIND,DRAWPANEL};
  97.  
  98. /* ------------------------------------------------------------ */
  99. /*                    ATTRIBUTES                                    */
  100. /* ------------------------------------------------------------ */
  101.  
  102. enum { VisibleBit=1, LockedBit, SelectedBit, DirtyBit,VirginBit };
  103. /* ------------------------------------------------------------ */
  104. /*                    BOXES IN PALETTE                            */
  105. /* ------------------------------------------------------------ */
  106.  
  107. enum {     POINTER    = 1,LINE,RECT,OVAL,TEXT};
  108. enum {     BLACK    = 6,DKGRAY,GRAY,LTGRAY,WHITE};
  109. enum {     LINEWT0    = 11,LINEWT1,LINEWT2,LINEWT3};
  110.  
  111. /* ------------------------------------------------------------ */
  112. /*                    RESOURCE IDS                                */
  113. /* ------------------------------------------------------------ */
  114.  
  115. #define    AboutID                1000        
  116. #define    HelpID                1001        
  117. #define ToolPaletteID         1000
  118. enum { WHITEPAT=1001,LTGRAYPAT,GRAYPAT,DKGRAYPAT,BLACKPAT };
  119. #define NUMMENUS        4
  120. enum {    AppleMenuID=1001,    FileMenuID,    EditMenuID,    ObjectMenuID };
  121.  
  122. /* ------------------------------------------------------------ */
  123. /*                    ITEM CHARACTERISTICS                        */
  124. /* ------------------------------------------------------------ */
  125.  
  126. #define PALETTEWIDTH        26
  127. #define PALETTEHEIGHT        17
  128. #define HANDLEWIDTH         5
  129. #define SELF                 ObjectH        /* smalltalk copycat */
  130.  
  131.  
  132.  
  133. #include "defines.h"
  134. #include "Prototypes.h"
  135.  
  136.